package com.sharesrc.umangadownloader.shared.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class MangaInfo implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 201307090950L;

	private String id;
	private String displayName;
	private String uniqueName;
	private String preview;
	private String link;
	private GroupInfo group;
	private List<ChapterInfo> chapters;

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getDisplayName() {
		return this.displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	public String getUniqueName() {
		return this.uniqueName;
	}

	public void setUniqueName(String uniqueName) {
		this.uniqueName = uniqueName;
	}

	public String getPreview() {
		return this.preview;
	}

	public void setPreview(String preview) {
		this.preview = preview;
	}

	public String getLink() {
		return this.link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	public GroupInfo getGroup() {
		return this.group;
	}

	public void setGroup(GroupInfo group) {
		this.group = group;
	}

	public ChapterInfo getLatestChapter() {
		return this.chapters.get(0);
	}

	public void setLatestChapter(ChapterInfo latestChapter) {
		this.chapters.add(0, latestChapter);
	}

	public List<ChapterInfo> getChapters() {
		return this.chapters;
	}

	public void setChapters(List<ChapterInfo> chapters) {
		this.chapters = chapters;
	}

	public MangaInfo() {
		super();
		this.id = "";
		this.displayName = "";
		this.uniqueName = "";
		this.preview = "";
		this.link = "";
		this.group = new GroupInfo();
		this.chapters = new ArrayList<ChapterInfo>();
	}

	public MangaInfo(String id, String displayName, String uniqueName, String preview, String link, GroupInfo group, List<ChapterInfo> chapters) {
		super();
		this.id = id;
		this.displayName = displayName;
		this.uniqueName = uniqueName;
		this.preview = preview;
		this.link = link;
		this.group = group;
		this.chapters = chapters;
	}
}
